package com.cc.mongo;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.CriteriaDefinition;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Repository;
@Repository
public class MongoDao {
	@Resource  
	protected MongoTemplate mongoTemplate;
	
	public List<Questions> query(CriteriaDefinition queryrule){
		List<Questions> record=mongoTemplate.find(Query.query(queryrule),Questions.class);
		return record;
	}
	public void save(Questions question){
		mongoTemplate.save(question);
	}
}
